<?php
/*
 * @Descripttion: 
 * @Author: 荷逸
 * @email: 563428234@qq.com
 * @Date: 2021-03-08 16:41:35
 */
/**
 * 后台角色模型
 * @author yupoxiong<i@yufuping.com>
 */

namespace app\admin\model;

class AdminRole extends Model
{
    protected $name = 'admin_role';

    public $softDelete = false;

    protected $searchField = [
        'name',
        'description'
    ];

    public $noDeletionId = [
        1
    ];

    public static function init(): void
    {
       
    }
    public static function onBeforeInsert($data)
    {
        $data->url = [1, 2, 18];
    }
    protected function getUrlAttr($value)
    {
        return $value !== '' ? explode(',', $value) : [];
    }

    protected function setUrlAttr($value)
    {
        return $value !== '' ? implode(',', $value) : [];
    }
}
